package com.shop.cereshop.app.dao.discount;

import com.shop.cereshop.app.page.discount.DiscountIndex;
import com.shop.cereshop.app.page.discount.ShopDiscountDetail;
import com.shop.cereshop.app.page.product.ProductDetail;
import com.shop.cereshop.app.page.tool.ToolProduct;
import com.shop.cereshop.app.param.discount.DiscountParam;
import com.shop.cereshop.app.param.renovation.RenovationParam;
import com.shop.cereshop.commons.domain.tool.CereShopDiscount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CereShopDiscountDAO {
    int deleteByPrimaryKey(Long shopDiscountId);

    int insert(CereShopDiscount record);

    int insertSelective(CereShopDiscount record);

    CereShopDiscount selectByPrimaryKey(Long shopDiscountId);

    int updateByPrimaryKeySelective(CereShopDiscount record);

    int updateByPrimaryKey(CereShopDiscount record);

    DiscountIndex findShop(@Param("shopId") Long shopId);

    List<ToolProduct> findProducts(DiscountParam param);

    ProductDetail findBySkuId(@Param("skuId") Long skuId, @Param("shopDiscountId") Long shopDiscountId);

    Long findByProductId(@Param("skuId") Long skuId);

    List<ShopDiscountDetail> getDiscounts(RenovationParam param);
}